unit UnitModificarPaciente; 

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  sqldb;

type

  { TFormModificacionPaciente }

  TFormModificacionPaciente = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    SQLQuery1: TSQLQuery;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end; 

var
  FormModificacionPaciente: TFormModificacionPaciente;

implementation

{$R *.lfm}

{ TFormModificacionPaciente }

procedure TFormModificacionPaciente.Button1Click(Sender: TObject);
begin
  Edit1.Text := uppercase(Edit1.Text);

  SQLQuery1.SQL.Text := 'update paciente set pte_nombre = ''' + Edit1.Text + ''', pte_dni = '''
    + Edit2.Text + ''' where pte_cdg = ' + Label3.Caption;

  SQLQuery1.ExecSQL;

  ShowMessage('Modificacion Exitosa');

  Close();
end;

procedure TFormModificacionPaciente.Button2Click(Sender: TObject);
begin
  Close;
end;

end.

